package com.zhsq.zlc.entity;

import java.util.ArrayList;
import java.util.List;

public class AuthorityTreeEntity implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	protected Integer id;
	protected String text;
	protected Integer parentId;
	protected List<AuthorityTreeEntity> nodes = new ArrayList<AuthorityTreeEntity>();

	public void addNodes(AuthorityTreeEntity entity) {
		if (nodes == null) {
			nodes = new ArrayList<AuthorityTreeEntity>();
		}
		nodes.add(entity);
	}
	public void addNodes(List<AuthorityTreeEntity> entityList) {
		if (nodes == null) {
			nodes = new ArrayList<AuthorityTreeEntity>();
		}
		nodes.addAll(entityList);
	}

	@Override
	public String toString() {
		return "AuthorityTreeEntity{" +
				"id=" + id +
				", text='" + text + '\'' +
				", parentId=" + parentId +
				", nodes=" + nodes +
				'}';
	}

	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}

	public Integer getParentId() {
		return parentId;
	}

	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

	public List<AuthorityTreeEntity> getNodes() {
		return nodes;
	}
	public void setNodes(List<AuthorityTreeEntity> nodes) {
		this.nodes = nodes;
	}
	
}
